import './assets/main.css'
import 'tdesign-vue-next/es/style/index.css';
import WujieVue from 'wujie-vue3'
import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import { useRoute } from 'vue-router';
const { setupApp, preloadApp, bus } = WujieVue;
bus.$on('sub-route-change', (name: string, path: string) => {
    const mainName = `${name}`;
    const mainPath = `/${name}${path}`
    const currentName = router.currentRoute.value.name
    const currentPath = router.currentRoute.value.path
    // debugger
    console.log('main', path, currentPath)

    if (mainName === currentName && mainPath !== currentPath) {
        router.push({ path: currentPath })
    }
})
// 更新测试
const app = createApp(App)
app.use(WujieVue)
app.use(createPinia())
app.use(router)
app.mount('#app')


